#ifndef _DYNAMICPROPERTYVALUE_H_
#define _DYNAMICPROPERTYVALUE_H_

#include "BoardGameEngine.h"

_BEGIN_BOARDGAME_NAMESPACE_


enum DynamicPropertyType
{
	DPT_Boolean,
	DPT_Integer,
	DPT_Float,
	DPT_String
};


class DynamicPropertyValue
{
public:
	DynamicPropertyValue( DynamicPropertyType type );

	DynamicPropertyType					GetType() const;

										operator bool() const;
										operator int() const;
										operator float() const;
										operator const tchar *() const;
										operator const tstring() const;
	
	DynamicPropertyValue &				operator=( bool value );
	DynamicPropertyValue &				operator=( int value );
	DynamicPropertyValue &				operator=( float value );
	DynamicPropertyValue &				operator=( const tchar * value );
	DynamicPropertyValue &				operator=( const tstring & value );

	friend tostream &					operator<<( tostream & os, const DynamicPropertyValue & value );

private:
	void								CheckType( DynamicPropertyType type ) const;

	DynamicPropertyType					m_type;
	bool								m_boolValue;
	int									m_intValue;
	float								m_floatValue;
	tstring								m_stringValue;
};


_END_BOARDGAME_NAMESPACE_

#endif